Funny Dog GIF
Funny Dog GIF

Introduction

In Project 4, I focused on dog walking observations, collecting data through a survey (Google Forms) where respondents answered multiple questions about weather, time of day, and the number of dogs they observed during their walks. For example, if a respondent went for a walk in the morning when it was sunny and observed five dogs, this was recorded. The purpose of this data collection was to determine the most common conditions was to identify the most common conditions under which people walk their dogs.

During the data collection process, I made adjustments to some questions to avoid questions being too restrictive. For instance, one question asked, “What type of person was walking the dog/dogs?” and the initial response options were “Child/Children, Teenager(s), Adult(s), and Elderly person/Elderly people”. However, I realised that respondents might observe more than one type of person walking dogs at the same time. To solve this, I adjusted the question to allow for flexibility in answers. I also added a new question, “Where did you make these observations?” to determine locations that observations were made. This is because if observations were made at a dog park, it is likely that there will be more dogs observed compared to a neighbourhood and this would interfere with my data collection.

To refine by data, I focused on three variables:

How many Dogs Observed per respondent?

The first plot created was How Many Dogs Observed per Respondent?, this was a bar chart to determine the most and least amount of dogs observed so that I can compare it to the weather and time of day

How Many Dogs Observed per Respondent
How Many Dogs Observed per Respondent

Does Weather Conditions Affect Amount of Dogs Being Walked?

The second plot I created was Does Weather Conditions Affect Amount of Dogs Being Walked?, this was a scatter plot. This scatter plot showed that less dogs were seen walking when it was raining and the most dogs were observed under sunny and cloudy weather.

Does Weather Conditions Affect Amount of Dogs Being Walked?
Does Weather Conditions Affect Amount of Dogs Being Walked?

Average Number of Dogs Observed by Time of Day

Thirdly, I created a column chart displaying Average Number of Dogs Observed By Time of Day. This chart had shown me that most dogs were walked during the evening and the least amount of dogs were walked in the morning.

Average Number of Dogs Observed by Time of Day
Average Number of Dogs Observed by Time of Day

Visual Data Story

My Visual Data Story

Learning Reflection

An important idea I learned from Module 4: *Creating Visual-Based Communications is allowing for creativity while keeping data simple. Data visualization can easily become complex and confusing to read and understand, therefore, it is important to find ways to be creative without overcomplicating. I learned different techniques to make my visualizations appealing and simple to follow. For example, using clear labels, using the right type of plots and avoiding cluttered data to ensure my data is simple to read and understand. Simplicity to me meant having clear labels and ensuring layouts are not crammed.

I am curious to see how creativity can be used in data today. I am interested in how I can increase engagement with users to explore data.

Walking Dog GIF
Walking Dog GIF

Appendix

## Part C: Creating visualisations
## Loading tidyverse package
library(tidyverse)
library(lubridate)
library(stringr)

## Using read_csv function and calling it logged_data
csv_file <- "https://docs.google.com/spreadsheets/d/e/2PACX-1vThJlvsfkFIfnvCMUV1VcjOo8XFFARY4C-_J_EqCCxytlXVXagIp_IYDKMBES8A_ic3UN4XfhT6j0Lr/pub?output=csv"
logged_data <- read_csv(csv_file)

## Manipulation 1: stringr functions on weather category
logged_data_clean <- logged_data %>%
  mutate(
    weather_data = str_trim(str_replace_all(`What was the weather like during your observations`, "\\s+", " "))
  )

## Manipulation 2: Summarising number of dogs observed by time of day
dogs_vs_time <- logged_data %>%
  group_by(`What time of day did you see these observations?`) %>%
  summarise(
    average_dogs = mean(`How many dogs did you see being walked?`, na.rm = TRUE),
    count = n()
  )

## Manipulation 3: mutate on Timestamp
logged_data_time <- logged_data %>%
  mutate(Timestamp = mdy_hms(Timestamp)) %>%
  mutate(Hour = hour(Timestamp))



## Three different data visualisations/plots
## First ggplot - Number of dogs seen being walked per observation
plot1 <- ggplot(logged_data) +
  geom_bar(aes(x = factor(`How many dogs did you see being walked?`)), 
           fill = "#c51b8a", color = "black") +
  labs(
    title = "How Many Dogs Observed per respondent?",
    x = "Number of Dogs Seen by Respondent",
    y = "Total number of dogs observed",
    caption = "Each respondent recorded the amount of dogs they had seen during the time of their observation"
  ) +
  scale_x_discrete(labels = function(x) as.character(x)) +
  theme_minimal() 

## Second ggplot - Amount of dogs observed under different weather conditions
plot2 <- ggplot(logged_data_clean, aes(x = weather_data, 
                              y = `How many dogs did you see being walked?`, 
                              colour = weather_data)) +
  geom_point(size = 3) +
  scale_colour_manual(values = c(
    "#fde0dd", "#fa9fb5", "#c51b8a", "#f1a7c5"  
  )) +  
  labs(
    title = "Does Weather Conditions Affect Amount of Dogs Being Walked?",
    x = "Weather Conditions",
    y = "Number of Dogs Observed",
    caption = "Each respondent recorded the weather conditions when they saw dogs being walked"
  ) +
  theme_minimal()

## Third ggplot - Time of day the dogs were walked
plot3 <- ggplot(dogs_vs_time) +
  geom_col(aes(x = `What time of day did you see these observations?`, 
               y = average_dogs, 
               fill = `What time of day did you see these observations?`)) +
  scale_fill_manual(values = c(
    "#fde0dd", "#fa9fb5", "#c51b8a"
  )) +  # Apply custom color palette here
  labs(
    title = "Average Number of Dogs Observed by Time of Day",
    x = "Time of Day",
    y = "Average Dogs",
    caption = "The average amount of dogs observed at each time of the day"
  ) +
  theme_minimal()

## Saving ggplots
ggsave("plot1.png", 
       plot = plot1, 
       width = 8, height = 6, 
       dpi = 300)

ggsave("plot2.png", 
       plot = plot2, 
       width = 8, height = 6, 
       dpi = 300)

ggsave("plot3.png", 
       plot = plot3, 
       width = 8, height = 6, 
       dpi = 300)